package com.dailywork.basepro.regex;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegexPro {
    public static void main(String[] args) {
        String str1 = "\\d*";
        String str2 = "4156ds35d56";
        // Pattern pattern = Pattern.compile(str1);
        // Matcher matcher = pattern.matcher(str2);
        // // matcher.matches();
        // // matcher.lookingAt();
        // CharSequence charSequence;
        // while (matcher.find()) {
        // charSequence = str2.subSequence(matcher.start(), matcher.end());
        // System.out.println(charSequence);
        // }
        String s = "aa";
        String p = "a*";
        Pattern pattern = Pattern.compile(p);
        Matcher matcher = pattern.matcher(s);
        System.out.println(matcher.matches());
        System.out.println(Pattern.matches(p, s));
        System.out.println(s.matches(p));
    }
}
